window.workspace = function(){
	var response  = <?#$respons?>;
	var store, grid;
	var sid = {'ip':Ext.id(), 'stream':Ext.id(), 'sdate':Ext.id(), 'edate':Ext.id()};
	store = new Ext.data.JsonStore({
	    autoDestroy	: true,
	    url			: '/admin/live/log/srsaction/dolist.html',
	    remoteSort	: true,
	    sortInfo	: {
	            field		: 'id',
	            direction	: 'DESC'
		},
		baseParams	: {
			start	: 0,
			limit	: main.pageSize
		},
		autoLoad		: true,
	    root			: 'dataset',
	 	totalProperty	: 'total',
	    fields			: ['id', 'action', 'client_id', 'ip',
	        'vhost', 'app', 'stream', 'memo', 'stime']
	});
	
 	grid = {
		xtype		: 'grid',
		title		: response.title,
	    store		: store,
		region		: 'center', 
	    columns		: [
			{header: 'ID', width:60, sortable:true, dataIndex:'id'},
			{header: 'Action', width:60, dataIndex:'action'},
			{header: 'Client_id', width:60, dataIndex:'client_id'},
			{header: 'Ip', width:60, dataIndex:'ip'},
			{header: 'Vhost', width:60, dataIndex:'vhost'},
			{header: 'App', width:60, dataIndex:'app'},
			{header: 'Stream', width:60, dataIndex:'stream'},
			{header: 'Memo', width:240, dataIndex:'memo'},
			{header: 'LastTime', width:100, dataIndex:'stime'}
		],
	    viewConfig	: {
	        forceFit	 : true,
	        scrollOffset : 0
	    },
	    stripeRows	: true,
	    tbar		: [{
			text	: 'Reload',
			iconCls	: 'icon-refresh',
			handler : function(){
				store.reload(); 
			}
	    },'-','<b>Search For：</b>','-','IP:',{
			xtype       : 'textfield',
			id	    	: sid.ip,
			width	    : 120
		},'-','Stream:',{
			xtype       : 'textfield',
			id	    	: sid.stream,
			width	    : 120
		},'-','LastTime:',{
			xtype       : 'datefield',
			id  		: sid.sdate,
			width	    : 120
		},'<->',{
			xtype       : 'datefield',
			id  		: sid.edate,
			width	    : 120
		},'-',{
			text			: 'Do Search',
			iconCls			: 'icon-search',
			handler: function() {
				store.baseParams.ip     = Ext.getCmp(sid.ip).getValue();
				store.baseParams.stream = Ext.getCmp(sid.stream).getValue();
				store.baseParams.sdate  = Ext.getCmp(sid.sdate).getValue();
				store.baseParams.edate  = Ext.getCmp(sid.edate).getValue();
				store.reload(); 
			}
		}],
		bbar		: new Ext.PagingToolbar({
			pageSize	: main.pageSize,
			store		: store,
			displayInfo	: true
		})
	};
	return grid;
}();